<?php
$GLOBALS['collectionId'] = get_post_meta($post->ID, 'collectionId', true);
$GLOBALS['showPageAsCollection'] = $GLOBALS['collectionId'] > 0;
$GLOBALS['collectionImgWidth'] = 200;
$GLOBALS['collectionImgHeight'] = 400;
$GLOBALS['collectionImgLargeWidth'] = 400;
$GLOBALS['collectionImgLargeHeight'] = 800;

get_header(); ?>
<?php if ($GLOBALS['showPageAsCollection']) { 
   get_template_part('collection');
} else {?>
<div class="random-model">
   <img class="impression" src="<?php bloginfo('template_url'); ?>/images/model/model-Jessy-small.png" alt="model Jessy"/>
   <img class="star-cloud" id="star-cloud-page-01" src="<?php bloginfo('template_url'); ?>/images/site/star-cloud.png" alt=""/>
</div>
<div class="page-content">
<?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?>

				<div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
					<?php if ( is_front_page() ) { ?>
						<h2 class="entry-title"><?php the_title(); ?></h2>
					<?php } else { ?>
						<h1 class="entry-title"><?php the_title(); ?></h1>
					<?php } ?>

					<div class="entry-content">
						<?php the_content(); ?>
						<?php wp_link_pages( array( 'before' => '<div class="page-link">' . __( 'Pages:', 'jeslee' ), 'after' => '</div>' ) ); ?>
						<?php edit_post_link( __( 'Edit', 'jeslee' ), '<span class="edit-link">', '</span>' ); ?>
					</div><!-- .entry-content -->
            </div><!-- #post-## -->

<?php endwhile; ?>
</div>
<div class="page-bottom"></div>
<?php }?> <!-- end condition if page is a collection page. -->
<?php get_sidebar(); ?>
<?php get_footer(); ?>
